package com.example.lvsuo.mapper;

import com.example.lvsuo.entity.SystemAuthority;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lvsuo.entity.vo.SystemAuthorityVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 系统权限表 Mapper 接口
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@Mapper
public interface SystemAuthorityMapper extends BaseMapper<SystemAuthority> {

    @Select("select * from system_authority where id in (select authority_id from system_role_authority where role_id=(select system_role_id from system_user_role where system_user_id=#{value}))")
    List<SystemAuthorityVo> querySa(String id);

    List<SystemAuthorityVo> getList();
    
    String getSystemAuthorityByid(String id);

    @Update(" update system_authority set authority_desc=#{authorityDesc} where id = #{id} ")
    void updateSystemAuthorityFid(SystemAuthority systemAuthority);
}
